package com.shopmall.common.config;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class WebConfig implements WebMvcConfigurer {
@Resource
private RequestInterceptor myInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myInterceptor)
    .addPathPatterns("/**") // 指定拦截的路径模式
    .excludePathPatterns("/ignore/**"); // 排除某些路径
}
}
